package org.lesson4_aop.service.aop;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class AopAspect {

    @Pointcut("execution(* org.lesson4_aop..*.*(..))")
    public void pc(){

    }

    @Before("pc()")
    public void log(){
        System.out.println("日志记录中.....");
    }

    @After("pc()")
    public void close(){
        System.out.println("操作结束....");
        System.out.println("--------------");
    }

}
